package code.rocky.chapter03;

public class Suggest38 {
    public static void main(String[] args) {
        Person person = new Person("Rocky编程日记");
        person.setHome(new Person.Home("广州","123"));
    }
}

class Person {
    // 姓名
    private String name;
    // 家庭
    private Home home;
    // 构造函数设置属性值
    public Person(String _name) {
        name = _name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setHome(Home home) {
        this.home = home;
    }

    public Home getHome() {
        return home;
    }

    public static class Home {
        // 家庭地址
        private String address;
        // 家庭电话
        private String tel;

        public Home(String _address, String _tel) {
            address = _address;
            tel = _tel;
        }
    }
}
